//
//  HomeSectionView.swift
//  HR
//
//  Created by zhenyu on 17/6/24.
//  Copyright © 2017年 allblue. All rights reserved.
//

import UIKit

class HomeSectionView: UIView {
  
  weak var title: UILabel!

  // MARK: - LifeCycle
  override init(frame: CGRect) {
    super.init(frame: frame)
    setViews()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  
  // MARK: - SetViews
  func setViews() {
    
    backgroundColor = UIColor.white
    
    let tagView = UIView().then { (v) in
      addSubview(v)
      v.backgroundColor = Color.theme
      v.layer.cornerRadius = 2.5
    }.then { (v) in
      v.snp.makeConstraints({ (make) in
        make.centerY.equalTo(self)
        make.left.equalTo(13)
        make.width.equalTo(5)
        make.height.equalTo(14)
      })
    }
    
    title = UILabel().then { (l) in
      addSubview(l)
      l.text = "最新招考"
      l.textColor = Color.font
      l.font = HRFont(size: 17)
    }.then { (l) in
      l.snp.makeConstraints({ (make) in
        make.centerY.equalTo(tagView)
        make.left.equalTo(tagView.snp.right).offset(6)
      })
    }
    
    _ = UIView().then { (v) in
      addSubview(v)
      v.backgroundColor = Color.line
    }.then({ (v) in
      v.snp.makeConstraints({ (make) in
        make.bottom.equalTo(self.snp.bottom)
        make.left.right.equalTo(self)
        make.height.equalTo(0.5)
      })
    })
  }
}
